<template>
  <div class="favorites">
    <a-tabs v-model:activeKey="activeKey" @tabClick="handleClick">
      <a-tab-pane key="1" tab="公告标讯">
        <Screening :activeName="activeName" ref="scre" />
        <div style="margin-top: 15px;">
          <el-table :data="tableData1" border style="width: 100%" :header-cell-style="{ 'text-align': 'center' }">
            <el-table-column prop="date" label="公告类型" width="180" align="center" />
            <el-table-column prop="name" label="标题信息" width="180" align="center" />
            <el-table-column prop="address" label="所属行业" align="center" />
            <el-table-column prop="address" label="收藏日期" align="center" />
            <el-table-column prop="address" label="操作" />
            <el-table-column prop="address" label="操作" align="center" width="120">
              <template #default>
                <el-button link type="primary" size="small" @click="ggquxClick">取消收藏</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </a-tab-pane>
      <a-tab-pane key="2" tab="企业公司">
        <Screening :activeName="activeName" ref="scre" />
        <div style="margin-top: 15px;">
          <el-table :data="tableData2" border style="width: 100%" :header-cell-style="{ 'text-align': 'center' }">
            <el-table-column prop="date" label="公司名称" width="180" align="center" />
            <el-table-column prop="name" label="经营范围" width="180" align="center" />
            <el-table-column prop="address" label="公司法人" align="center" />
            <el-table-column prop="address" label="收藏日期" align="center" />
            <el-table-column prop="address" label="操作" align="center" width="120">
              <template #default>
                <el-button link type="primary" size="small" @click="qyqxscClick">取消收藏</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script setup>
import Screening from '../screening/index.vue'
import { ref } from 'vue'
// 暴露数据  
let scre = ref([])
const activeName = ref('公告标讯')
const handleClick = (tab) => {
  console.log(tab)
  if (tab == '1') {
    activeName.value = '公告标讯'
  } else {
    activeName.value = '企业公司'
  }
}
const tableData1 = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]

const tableData2 = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
const ggquxClick = () => {

}

const qyqxscClick = () => {

}


</script>

<style lang="scss" scoped>
.favorites {
  height: 940px;
  padding: 20px;
  background-color: #fff;
}


.is-active {}
</style>
